package com.itheima.jdk8date;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * 获取时间日期对象
 */
public class Test02 {

    public static void main(String[] args) {
        //now
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);

        //of
        LocalDateTime duoshou = LocalDateTime.of(2020, 11, 11, 0, 0, 35);
        System.out.println(duoshou);


        LocalDate now1 = LocalDate.now();
        System.out.println(now1);
        LocalTime time = LocalTime.of(15, 30, 30);
        System.out.println(time);

        int monthValue = now.getMonthValue();
        System.out.println(monthValue);
        System.out.println(now.getMonth());
        System.out.println(now.getDayOfMonth());
        System.out.println(now.getDayOfYear());
        System.out.println(now.getDayOfWeek());
    }
}
